<%-- 
    Document   : list-poduct
    Created on : Aug 22, 2011, 8:40:11 PM
    Author     : NhatHuy
--%>

<%@page import="pojo.GiayPOJO"%>
<%@page import="dao.GiayDAO"%>
<%@page import="dao.LoaiGiayDAO"%>
<%@page import="pojo.LoaiGiayPOJO"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%
    //Lấy danh sách giày tìm thấy.
    ArrayList<GiayPOJO> dsGiay = new ArrayList<GiayPOJO>();
    if (request.getAttribute("dsGiay") != null){
        dsGiay = (ArrayList<GiayPOJO>) request.getAttribute("dsGiay");
    }
    
    //Xóa thuộc tính.
    request.removeAttribute("dsGiay");
%>

<div id="list-poduct"><!--Start list-poduct-->
    <%if (dsGiay.size() == 0 && request.getParameter("slGioiTinh") != null){ //Nếu không tìm thấy.
        
    %>
        <p style="color: red; text-align: center">Không tìm thấy bất kỳ sản phẩm nào thỏa yêu cầu tìm kiếm</p>
    <%}%>
    <%         
        for (int i=0; i<dsGiay.size(); i++){ 
            GiayPOJO giay = dsGiay.get(i);
    %>
        <div id="poduct" onMouseOver="show_submit('v<%=(i+1)%>')" onMouseOut="hide_submit('v<%=(i+1)%>')"><!--Start poduct-->
            <a rel="prettyPhoto" href="<%=request.getContextPath()%>/client/<%=giay.getHinhAnh()%>">
            <form method="post" action=""><input type="submit" name="subview" value="ảnh lớn" style="visibility: hidden; position: relative;" id="v<%=(i+1)%>" class="button"> 
            </form></a><a href="<%=request.getContextPath()%>/ChiTietGiayController?Action=View&GioiTinh=<%=giay.getGioiTinh()%>&MaLoaiGiay=<%=giay.getMaLoaiGiay()%>&MaGiay=<%=giay.getMaGiay()%>"><img src="<%=request.getContextPath()%>/client/<%=giay.getHinhAnh()%>"> </a>
            <div id="text1">
                <a href="<%=request.getContextPath()%>/ChiTietGiayController?Action=View&GioiTinh=<%=giay.getGioiTinh()%>&MaLoaiGiay=<%=giay.getMaLoaiGiay()%>&MaGiay=<%=giay.getMaGiay()%>"><%=giay.getTenGiay()%></a> 
            <%
                if (giay.getMaTinhTrang() == 1){%>
                    <IMG src="<%=request.getContextPath()%>/client/images/new.jpg">
                <%}%>
            </div>
            <div id="text2"><%= giay.getGiaBan()%> </div>
            <div id="text3"></div>
            <%
                if (session.getAttribute("KhachHang") != null){
            %>
                <a href="<%=request.getContextPath()%>/GioHangController?action=Them&MaGiay=<%=giay.getMaGiay()%>">
                    <img src="<%=request.getContextPath()%>/client/images/btThemVaoGio.png" class="btThemVaoGio" />
                </a>
            <% }%>
        </div><!--End poduct-->
    <%}%>
    <div class="clear"></div>
</div><!--End list-poduct-->
